package com.incom.log.server.conf;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.InputStream;
import java.util.*;

public class ServiceConfig {

    /**
     * 全局唯一，这标记的服务的装太，一旦设置为false，系统不就将自动停止。
     */
    public static volatile boolean serverRunSts = true;

    private Logger log = LoggerFactory.getLogger(ServiceConfig.class);

    private ResourcePropertites p;

    public ServiceConfig() {
        try {
            InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("log-service.properties");
            p = ResourcePropertites.getInstance();
            p.load(is);
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    }

    public Properties getProperties() {
        return p;
    }
}
